import Vue from 'vue'
import VueRouter from 'vue-router'
import WelcomeView from "../views/WelcomeView.vue";
import AdminView from "@/views/AdminView";


Vue.use(VueRouter)

const routes = [
  {
    path: '/admin',
    component: AdminView,
    redirect: '/admin/index', // 重定向
    children: [

      {
        path: '/admin/index',
        component: () => import('../views/admin/AdminIndex.vue')
      },
      //  关于餐品管理
      {
        path: '/admin/food',
        component: () => import('../views/admin/food/FoodListView.vue')
      },
      {
        path: '/admin/older-food-package',
        component: () => import('../views/admin/foodPackage/OlderFoodLinkView.vue')
      },
      {
        path: '/admin/food-package',
        component: () => import('../views/admin/foodPackage/FoodPackageListView.vue')
      },
      {
        path: '/admin/staff/link',
        component: () => import('../views/admin/staff/OlderStaffLinkView.vue')
      },
        //外出申请
      {
        path: '/admin/outgoing',
        component: () => import('../views/admin/outgoing/OutgoingListView.vue')
      },
      {
        path: '/admin/event',
        component: () => import('../views/admin/event/EventListView.vue')
      },
      {
        path: '/admin/finance/list',
        component: () => import('../views/admin/finance/FinanceListView.vue')
      },
        //入住登记信息
      {
        path: '/admin/check/checkInfo',
        component: () => import('../views/admin/check/CheckInfoAdminView.vue')
      },
      //入住登记信息添加
      {
        path: '/admin/check/checkInfo/addNew',
        component: () => import('../views/admin/check/CheckInfoAdminAddNewView.vue')
      },
      //入住登记信息修改
      {
        path: '/admin/check/checkInfo/update',
        component: () => import('../views/admin/check/CheckInfoAdminUpdateView.vue')
      },
        //床位分配
      {
        path: '/admin/bed/list',
        component: () => import('../views/admin/bed/BedAdminView.vue')
      }
      ,
      //添加床位
      {
        path: '/admin/bed/add-new',
        component: () => import('../views/admin/bed/BedAdminAddNewView.vue')
      },
      // 老人管理
      {
        path: '/admin/older/list',
        component: () => import('../views/admin/older/OlderListView.vue')
      },
      {
        path: '/admin/older/add-new',
        component: () => import('../views/admin/older/OlderAddNewView.vue')
      },
      {
        path: '/admin/older/update',
        component: () => import('../views/admin/older/OlderUpdateView.vue')
      },
      //拜访人员管理
      {
        path: '/admin/visitor/add-new',
        component: () => import('../views/admin/visitor/VisitorAddNewView.vue')
      },
      {
        path: '/admin/visitor/list',
        component: () => import('../views/admin/visitor/VisitorListView.vue')
      },
      {
        path: '/admin/visitor/update',
        component: () => import('../views/admin/visitor/VisitorAdminUpdateView.vue')
      },
      // 药品管理
      {
        path: '/admin/medicine/list',
        component: () => import('../views/admin/medicine/MedicineListView.vue')
      },
      {
        path: '/admin/medicine/add-new',
        component: () => import('../views/admin/medicine/MedicineAddNewView.vue')
      },
      {
        path: '/admin/medicine/update',
        component: () => import('../views/admin/medicine/MedicineUpdateView.vue')
      },
      // 病例管理
      {
        path: '/admin/ill/list',
        component: () => import('../views/admin/ill/IllListView.vue')
      },
      {
        path: '/admin/ill/add-new',
        component: () => import('../views/admin/ill/IllAddNewView.vue')
      },
      {
        path: '/admin/ill/update',
        component: () => import('../views/admin/ill/IllUpdateView.vue')
      },
        //员工管理
      {
        path: '/admin/staff/add-new',
        component: () => import('../views/admin/staff/StaffAddNewView.vue')
      },
      {
        path: '/admin/staff/list',
        component: () => import('../views/admin/staff/StaffListView.vue')
      },
    ]


  },
  {
    path: '/',
    redirect:'/welcome',
  },
  {
    path: '/welcome',
    name: 'welcome',
    redirect:'/welcome/index',
    component:WelcomeView,
    children: [
      {
        path: '/welcome/index',
        component: () => import('../views/index/IndexView.vue')
      },
      {
        path: '/welcome/content',
        redirect:'/welcome/content/info',
        component: () => import('../views/index/IndexContentView.vue'),
        children:[
          {
            path: '/welcome/content/info',
            component: () => import('../views/index/content/SimpleInfoView.vue'),
          },
          {
            path: '/welcome/content/equipment',
            component: () => import('../views/index/content/EquipmentInfoView.vue'),
          },
          {
            path: '/welcome/content/medical',
            component: () => import('../views/index/content/MedicalInfoView.vue'),
          },
          {
            path: '/welcome/content/food',
            component: () => import('../views/index/content/FoodInfoView.vue'),
          },






        ]
      },
    ]
  },
  {
    path: '/login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/reg',
    component: () => import('../views/RegView.vue')
  }




]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
